<?php
/*
 * This file is part of SoftSite.
 *
 * (c) 2012 Steve Tredinnick
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

/**
 *
 *
 * @package softsite
 * @author  Steve Tredinnick <steve.tredinnick@gmail.com>
 */

namespace Lib\Forms\Elements;

use Lib\Forms\Elements\InputElement;

class SearchElement extends InputElement
{
    public function __construct($name)
    {
        parent::__construct();
        $this->SetType("checkbox");
        $this->SetName($name);
    }

    public function SetAutocomplete($autocomplete = true)
    {
        parent::SetAutocomplete($autocomplete);
    }

    /**
     * The maxlength attribute specifies the maximum number of characters allowed in the <input> element.
     *
     * @param $maxLength
     */
    public function SetMaxLength($maxLength)
    {
        parent::SetMaxLength($maxLength);
    }

    /**
     * The pattern attribute specifies a regular expression that the <input> element's value is checked against.
     * Note: The pattern attribute works with the following input types: text, search, url, tel, email, and password.
     *
     * @param string $pattern
     */
    public function SetPattern($pattern)
    {
        parent::SetPattern($pattern);
    }

    /**
     * The placeholder attribute specifies a short hint that describes the expected value of an input field (e.g. a sample value or a short description of the expected format).
     * The hint is displayed in the input field when it is empty, and disappears when the field gets focus.
     * Note: The placeholder attribute works with the following input types: text, search, url, tel, email, and password.
     *
     * @param string $placeholder
     */
    public function SetPlaceholder($placeholder)
    {
        parent::SetPlaceholder($placeholder);
    }

    /**
     * The required attribute is a boolean attribute.
     * When present, it specifies that an input field must be filled out before submitting the form.
     * Note: The required attribute works with the following input types: text, search, url, tel, email, password, date pickers, number, checkbox, radio, and file.
     *
     * @param bool $required
     */
    public function SetRequired($required)
    {
        parent::SetRequired($required);
    }

    /**
     * The size attribute specifies the visible width, in characters, of an <input> element.
     * Note: The size attribute works with the following input types: text, search, tel, url, email, and password.
     * Tip: To specify the maximum number of characters allowed in the <input> element, use the maxlength attribute.
     *
     * @param $size
     */
    public function SetSize($size)
    {
        parent::SetSize($size);
    }

}
